import request from "@/api/myRequest";
//获取文章列表
function getArticleListApi(start, limit, data) {
  return request({
    url: `/lejuAdmin/productArticle/findArticles/${start}/${limit}`,
    method: "POST",
    data,
  });
}
//更新文章
function changeShowApi(data) {
  return request({
    url: `/lejuAdmin/productArticle/changeShowStatus`,
    method: "POST",
    data,
  });
}
//删除文章
function delArticleApi(id) {
  return request({
    url: `/lejuAdmin/productArticle/del/${id}`,
    method: "DELETE",
  });
}
//新增文章
function addArticleApi(data) {
  return request({
    url: `/lejuAdmin/productArticle/addArticle`,
    method: "POST",
    data,
  });
}
//  查询文章明细
function articleDetailApi(id) {
  return request({
    url: `/lejuAdmin/productArticle/productArticle/${id}`,
    method: "GET",
  });
}
//更新文章
function updateArticle(data) {
  return request({
    url: `/lejuAdmin/productArticle/updateArticle`,
    method: "POST",
    data,
  });
}
export default {
  getArticleListApi,
  changeShowApi,
  delArticleApi,
  addArticleApi,
  articleDetailApi,
  updateArticle,
};
